﻿using SportsPlatform.BaseModels;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SportsPlatform.Model.PermissionManagement
{
    /// <summary>
    /// 后台管理账户人员信息表,用户基本信息存放，可以扩展
    /// </summary>
    [Table("PM_UserInfo")]
    public class UserInfo : BaseModel
    {
        /// <summary>
        /// 登录名
        /// </summary>
        [Required]
        [MaxLength(20)]
        public string LoginName { get; set; }

        /// <summary>
        /// 登录密码 MD5加密32位全大写
        /// </summary>
        [Required]
        [MaxLength(32)]
        public string PassWord { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        [Required]
        [MaxLength(20)]
        public string UserName { get; set; }

        /// <summary>
        /// 身份证号
        /// </summary>
        [MaxLength(20)]
        public string UserIdNo { get; set; }

        /// <summary>
        /// 身份证照片
        /// </summary>
        [MaxLength(500)]
        public string UserIdNoPhoto { get; set; }

        /// <summary>
        /// 是否拥有全部权限，true是，false或null不是
        /// </summary>
        public bool? IsAllPermission { get; set; }

        /// <summary>
        /// 照片头像
        /// </summary>
        [MaxLength(500)]
        public string UserPhoto { get; set; }

        /// <summary>
        /// 出生日期
        /// </summary>
        public DateTime? UserDateOfBirth { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [MaxLength(4)]
        public string UserSex { get; set; }

        /// <summary>
        /// 手机号码
        /// </summary>
        [Required]
        [MaxLength(11)]
        public string UserTel { get; set; }

        /// <summary>
        /// 备注介绍
        /// </summary>
        [Column(TypeName = "text")]
        public string Remark { get; set; }

        /// <summary>
        /// 部门Id
        /// </summary>
        public Guid? DepartmentId { get; set; }

        /// <summary>
        /// 公司Id，属于平台默认0
        /// </summary>
        public Guid? CompanyId { get; set; }

        /// <summary>
        /// 角色Id
        /// </summary>
        public Guid? RoleId { get; set; }

        /// <summary>
        /// 平台Id
        /// </summary>
        public Guid? PlatformId { get; set; }

        /// <summary>
        /// 状态，是否启用
        /// </summary>
        public bool States { get; set; }

        /// <summary>
        /// 登录时间
        /// </summary>
        public DateTime? LoginTime { get; set; }
    }
}
